home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / Hackable AirPort Network Seeker / HANS.txt < prev   
Encoding:
Text File  |  2001-06-23  |  1.8 KB  |  58 lines

  1. -- HANS: The Hackable AirPort Network Seeker
  2. -- (For seeking out Hackable AirPort Networks)
  3. -- Copyright (C) 2001 Daniel Fox
  4.  
  5. -- This program is free software; you can redistribute it and/or
  6. -- modify it under the terms of the GNU General Public License
  7. -- as published by the Free Software Foundation; either version 2
  8. -- of the License, or any later version.
  9.  
  10. -- This program is distributed in the hope that it will be useful,
  11. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. -- GNU General Public License for more details.
  14.  
  15. -- You should have received a copy of the GNU General Public License
  16. -- along with this program; if not, you can download it from:
  17. -- http://www.gnu.org/copyleft/gpl.html
  18.  
  19. -- If you modify this program, please send a copy back to me: djfox@mac.com
  20.  
  21. -- property idleTime : 1
  22.  
  23. tell application "AirPort Scripting"
  24.     
  25.     repeat
  26.         set rachel to scan true
  27.         set numNets to (number of items in rachel as list) as integer
  28.         set NetList to ""
  29.         
  30.         if (numNets > 0) then
  31.             set i to 1
  32.             repeat while (i ≤ numNets)
  33.                 set currentNet to (name of item i of rachel)
  34.                 set NetList to NetList & currentNet & ", "
  35.                 set i to (i + 1)
  36.             end repeat
  37.             
  38.             set NetList to NetList as string
  39.             set nll to (length of NetList as integer) - 2
  40.             set NetList to (characters 1 through nll of NetList)
  41.             
  42.             tell application "Finder"
  43.                 -- say "AirPort, AirPort, AirPort"
  44.                 say "" & numNets & " networks are available: " & NetList
  45.             end tell
  46.         else
  47.             tell application "Finder"
  48.                 say "There are no AirPort networks available. You stupid hacker"
  49.             end tell
  50.             -- "No Networks are available."
  51.             -- "I found an encrypted AirPort Network"
  52.             -- Ping network: Can I get on the 'net
  53.             
  54.         end if
  55.         -- log NetList
  56.         -- delay idleTime
  57.     end repeat
  58. end tell